package models

import (
	"math/rand"
	"strconv"
	"time"
)

func check(arr []int)([]int)  {
	var newarr []int
	for i:=0;i<len(arr);i++{
		repeat :=false
		for j:=i+1;j<len(arr);j++{
			if arr[i]==arr[j]{
				repeat=true
				break
			}
		}
		if !repeat{
			newarr=append(newarr,arr[i])
		}
	}
	return newarr
}

func sort(arr []int)([]int)  {
	for i:=0;i<len(arr);i++{
		for j:=i+1;j<len(arr);j++{
			if arr[j]<arr[i]{
				arr[j],arr[i]=arr[i],arr[j]
			}
		}
	}
	return arr
}

func red5(arr []int)([]int)  {
	rand.Seed(time.Now().UnixNano())
	for{
		if len(arr)<5{
			arr=append(arr,rand.Intn(35)+1)
			arr=check(arr)
		}else {
			break
		}
	}
	return arr
}

func r6(arr []int)([]int)  {
	rand.Seed(time.Now().UnixNano())
	for{
		if len(arr)<6{
			arr=append(arr,rand.Intn(35)+1)
			arr=check(arr)
		}else {
			break
		}
	}
	return arr
}

func red6(arr []int)([]int)  {
	rand.Seed(time.Now().UnixNano())
	for{
		if len(arr)<6{
			arr=append(arr,rand.Intn(33)+1)
			arr=check(arr)
		}else {
			break
		}
	}
	return arr
}

func red7(arr []int)([]int)  {
	rand.Seed(time.Now().UnixNano())
	for{
		if len(arr)<7{
			arr=append(arr,rand.Intn(33)+1)
			arr=check(arr)
		}else {
			break
		}
	}
	return arr
}
func blue()(int)  {
	rand.Seed(time.Now().UnixNano())
	b:=rand.Intn(16)+1
	return b
}

func blue2(arr []int)([]int)  {
	rand.Seed(time.Now().UnixNano())
	for{
		if len(arr)<2{
			arr=append(arr,rand.Intn(12)+1)
			arr=check(arr)
		}else {
			break
		}
	}
	return arr
}
func blue3(arr []int)([]int)  {
	rand.Seed(time.Now().UnixNano())
	for{
		if len(arr)<3{
			arr=append(arr,rand.Intn(12)+1)
			arr=check(arr)
		}else {
			break
		}
	}
	return arr
}
func RB6()(string)  {
	var red []int
	r6:=red6(red)
	s6:=sort(r6)
	b:=blue()
	var s string
	for i:=0;i<len(s6);i++{
		ss:=strconv.Itoa(s6[i])
		s=s+ss+" "
	}
	bb:=strconv.Itoa(b)
	return s+": "+bb
}
func RB7()(string)  {
	var red []int
	r6:=red7(red)
	s6:=sort(r6)
	b:=blue()
	var s string
	for i:=0;i<len(s6);i++{
		ss:=strconv.Itoa(s6[i])
		s=s+ss+" "
	}
	bb:=strconv.Itoa(b)
	return s+": "+bb
}
func D5()(string)  {
	var red []int
	r5:=red5(red)
	s5:=sort(r5)
	var blue []int
	b:=blue2(blue)
	b2:=sort(b)
	var s string
	for i:=0;i<len(s5);i++{
		ss:=strconv.Itoa(s5[i])
		s=s+ss+" "
	}
	var b21 string
	for i:=0;i<len(b2);i++{
		ss:=strconv.Itoa(b2[i])
		b21=b21+ss+" "
	}
	return s+": "+b21
}
func D53()(string)  {
	var red []int
	r5:=red5(red)
	s5:=sort(r5)
	var blue []int
	b:=blue3(blue)
	b2:=sort(b)
	var s string
	for i:=0;i<len(s5);i++{
		ss:=strconv.Itoa(s5[i])
		s=s+ss+" "
	}
	var b21 string
	for i:=0;i<len(b2);i++{
		ss:=strconv.Itoa(b2[i])
		b21=b21+ss+" "
	}
	return s+": "+b21
}
func D6()(string)  {
	var red []int
	r5:=r6(red)
	s5:=sort(r5)
	var blue []int
	b:=blue2(blue)
	b2:=sort(b)
	var s string
	for i:=0;i<len(s5);i++{
		ss:=strconv.Itoa(s5[i])
		s=s+ss+" "
	}
	var b21 string
	for i:=0;i<len(b2);i++{
		ss:=strconv.Itoa(b2[i])
		b21=b21+ss+" "
	}
	return s+": "+b21
}